import Network from '@/utils/request'

// 获取员工的简单列表
export const getEmployeeSimple = () => Network.get('/sys/user/simple')
// 获取员工的综合列表数据
export const getEmployeeList = (page, size) => Network.get(`/sys/user?page=${page}&size=${size}`)
// 删除员工
export const delEmployee = (id) => Network.delete(`/sys/user/${id}`)
// 新增员工
export const addEmployee = (data) => Network.post('/sys/user/', data)
// 保存员工的基本信息
export const saveUserDetailById = (data) => Network.put(`/sys/user/${data.id}`, data)
// 导入员工
export const importEmployee = (data) => Network.post('/sys/user/batch', data)
// 读取用户详情的基础信息
export const getPersonalDetail = (id) => Network.get(`/employees/${id}/personalInfo`)
// 更新用户详情的基础信息
export const updatePersonal = (data) => Network.put(`/employees/${data.userId}/personalInfo`, data)
// 获取用户的岗位信息
export const getJobDetail = (id) => Network.get(`/employees/${id}/jobs`)
// 保存岗位信息
export const updateJob = (data) => Network.put(`/employees/${data.userId}/jobs`, data)
// 给用户分配角色
export const assignRoles = (data) => Network.put('/sys/user/assignRoles', data)
